package com.logistics.controller;

import com.logistics.common.Result;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * 首页控制器
 */
@RestController
@RequestMapping("/")
public class IndexController {
    
    /**
     * 系统信息
     */
    @GetMapping
    public Result<Map<String, Object>> index() {
        Map<String, Object> info = new HashMap<>();
        info.put("name", "物流配送管理系统");
        info.put("version", "1.0.0");
        info.put("status", "running");
        info.put("message", "系统运行正常");
        return Result.success(info);
    }
    
    /**
     * 健康检查
     */
    @GetMapping("/health")
    public Result<String> health() {
        return Result.success("healthy");
    }
}

